<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>">
    
    <title>列表页面</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	   <link rel="stylesheet" href="/css/pager.css" type="text/css"></link>
	<script type="text/javascript" src="/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="/js/pageView.js"></script> 
	<link href="/css/houseManage.css" rel="stylesheet" type="text/css" />
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	 <script type="text/javascript">
	 String.prototype.trim = function() {
		return this.replace(/^\s+|\s+$/g, "");
	}
		$(document).ready(function() {
				var title = "${title}";
			 	$("#searchText").val(title);	
			})	
			
		function clickCondition(pageNo,title){
			window.location.href ="/managerInfo.do?method=viewSearchPager&pageNo="+pageNo+"&title="+encodeURI(encodeURI(title));
		}
		// 分页
		function pageNoId(pageNo) {		
		 	var title = $("#searchText").val();		 
			clickCondition(pageNo,title)
		}		
			//搜索
		function search(){
			var title = $("#searchText").val();
			 if(title.trim()!=""){
				window.location.href ="/managerInfo.do?method=viewSearchPageByparameter&title="+encodeURI(encodeURI(title));
			}else if(title.trim()== ""||title.trim()== null){
				window.location.href ="/managerInfo.do?method=viewSearchPage";
			}
		}		 
		</script>
  </head>
  
  <body>        
          
   <div style="jack_ts_cd_div3"> 
             	<div class="jack_t_c_typeTitle2">
                 	<span>输入套餐/团购信息标题名称:</span>
             	</div>
                 <div class="jack_t_c_searchTitle">
                 	<input type="text" id="searchText" />
             	</div>
                 <div class="jack_t_c_search"> 
                 <input type="button" value="搜索" onclick="search();"/>                  	
                 </div> 
 	</div> 
 	<div style="clear:both;"></div>      
   <!-- 任务 列表  div  开始 -->
      <div class="cao_gaojisousuo_rw2" >
		<div class="cao_gaojisousuo_axmcz02">
			<h4>ID</h4>
			<h3>套餐/团购名称 </h3>
			<h3>套餐类型</h3>
			<h3>商家</h3>
			<h3>折扣价</h3>
			<h3>最大人数</h3>
			<h3>套餐数目</h3>
			<h4>操作  </h4>
			<div style="clear:both;"></div>
		</div>
	 <c:forEach items="${pager.resultList}" var="u" >
				<div class="cao_gaojisousuo_nr">
					<h4>
						${u.id}
					</h4>
					<h3>
						${u.PackageName}
					</h3>
					<h3>
						<c:if test="${u.PackType==1}">
							套餐
						</c:if>
						<c:if test="${u.PackType==2}">
							团购
						</c:if>
					</h3>
					<h3>
						${u.realName}
					</h3>
					<h3>${u.zhekou}</h3>
					<h3>${u.PackageMaxPeople}</h3>
					<h3>${u.PackNum}</h3>
					<h4>
						<span><a href="/managerInfo.do?method=delete&id=${u.id}" onClick="return confirm('是否确定要删除该条信息?')?true:false;">删除</a></span>

					</h4>		
					
					<div style="clear: both;"></div>
				</div>
				</c:forEach>
            <!-- 任务 列表  div  结束 -->
            </div>
          
          <div id="pager" style="width: 500px; float:left;margin:0px auto 20px 200px;">
			<script type="text/javascript">
		            var pager = new PagerView('pager');
		            //共计多少条信息
		            pager.itemCount = ${pager.rowCount};
					//共计多少页
					pager.pageCount=${pager.pageCount};
					//每页显示记录数
					pager.size =${pager.pageSize};
					//当前页码, 从1开始
					pager.index =${pager.pageNo} ;
					//alert(pager.index);
					pager.render();
				</script>
				</div>
  </body>
</html>